<template>
  <div class="relative isolate overflow-hidden bg-white py-16 sm:py-24 lg:py-32 w-full">
    <div class="mx-auto max-w-7xl px-6 lg:px-8">
      <div class="mx-auto grid max-w-2xl grid-cols-1 gap-x-8 gap-y-16 lg:max-w-none lg:grid-cols-2">
        <div class="max-w-xl lg:max-w-lg">
          <h2 class="text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl">订阅我们的公众号</h2>
          <p class="mt-4 text-lg leading-8 text-gray-700">你们的支持，就是我们开发的动力。</p>
          <div class="mt-6 flex max-w-md gap-x-4">
            <label for="email-address" class="sr-only">邮件地址</label>
            <input id="email-address" name="email" type="email" autocomplete="email" required=""
                   class="min-w-0 flex-auto rounded-md border-0 bg-gray-100 px-3.5 py-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-indigo-500 sm:text-sm sm:leading-6"
                   placeholder="请输入您的邮箱"/>
            <button @click="open" type="submit"
                    class="flex-none rounded-md bg-indigo-500 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-indigo-400 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500">
              打赏
            </button>
          </div>
        </div>
        <dl class="grid grid-cols-1 gap-x-8 gap-y-10 sm:grid-cols-2 lg:pt-2">
          <div class="flex flex-col items-start">
            <div class="rounded-md bg-gray-100 p-2 ring-1 ring-gray-300">
              <CalendarDaysIcon class="h-6 w-6 text-gray-900" aria-hidden="true"/>
            </div>
            <dt class="mt-4 font-semibold text-gray-900">每日金句</dt>
            <dd class="mt-2 leading-7 text-gray-700">学习使人进步。</dd>
          </div>
          <div class="flex flex-col items-start">
            <div class="rounded-md bg-gray-100 p-2 ring-1 ring-gray-300">
              <HandRaisedIcon class="h-6 w-6 text-gray-900" aria-hidden="true"/>
            </div>
            <dt class="mt-4 font-semibold text-gray-900">无垃圾邮件</dt>
            <dd class="mt-2 leading-7 text-gray-700">官方保证</dd>
          </div>
        </dl>
      </div>
    </div>
    <div class="absolute left-1/2 top-0 -z-10 -translate-x-1/2 blur-3xl xl:-top-6" aria-hidden="true">
      <div class="aspect-[1155/678] w-[72.1875rem]"
           style="clip-path: polygon(74.1% 44.1%, 100% 61.6%, 97.5% 26.9%, 85.5% 0.1%, 80.7% 2%, 72.5% 32.5%, 60.2% 62.4%, 52.4% 68.1%, 47.5% 58.3%, 45.2% 34.5%, 27.5% 76.7%, 0.1% 64.9%, 17.9% 100%, 27.6% 76.8%, 76.1% 97.7%, 74.1% 44.1%)"/>
    </div>
    <div>
      <Message
          v-model:visible="isMessageVisible"
          title="打赏"
          content="您确定要打赏吗？"
          confirm="确定"
          cancel="取消"
      >
        <img src="@/assets/instruction/images/payMentCode.jpg" alt=""  sizes="200px">
        </Message>
    </div>
  </div>
</template>

<script lang="ts" setup>
import {ref} from "vue"
import {CalendarDaysIcon, HandRaisedIcon} from '@heroicons/vue/24/outline'
import Message from "@/components/message.vue"

const isMessageVisible = ref(false)
const open = () => {
  isMessageVisible.value = true
}
</script>